﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace HuntTheWumpus
{
	public partial class MenuForm : Form
	{
		public static GameControl mainGameControl = new GameControl();
		public MenuForm()
		{
			InitializeComponent();
		}

		private void exitB_Click(object sender, EventArgs e)
		{
			this.Close();
		}

		private void helpB_Click(object sender, EventArgs e)
		{
			MessageBox.Show("This is helpful!", "Help");
		}

		private void viewB_Click(object sender, EventArgs e)
		{
			HighScoreForm hs = new HighScoreForm();
			hs.Show();
			
		}

		private void newB_Click(object sender, EventArgs e)
		{
			caveGB.Visible = !caveGB.Visible;
			nameTB.Visible = !nameTB.Visible;
			nameL.Visible = !nameL.Visible;
			helpB.Visible = !helpB.Visible;
			selectB.Visible = !selectB.Visible;
			if (newB.Text == "&New Game")
			{
				newB.Text = "&Back";
			}
			else
				newB.Text = "&New Game";
		}

		private void selectB_Click(object sender, EventArgs e)
		{
            int cave;
            if (cave1RB.Checked)
                cave = 1;
            else if (cave2RB.Checked)
                cave = 2;
            else if (cave3RB.Checked)
                cave = 3;
            else if (cave4RB.Checked)
                cave = 4;
            else
                cave = 5;
            mainGameControl.startGame(cave);
			GameForm gf = new GameForm();
			this.Visible = false;
			gf.ShowDialog();
			this.Visible = true;
		}

		private void MenuForm_Load(object sender, EventArgs e)
		{

		}
	}
}
